package com.wnnight.wys.entity.config;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.wnnight.wys.entity.repairs.RepairsPlace;
import com.wnnight.wys.entity.role.Role;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.List;

/**
 * @ClassName: PropertyStaff
 * @Description: //物业人员实体类
 * @author: LZJ
 * @date: 2022/8/27-17:22
 * @version: v1.0
 */
@Getter
@Setter
@ToString //dz
@TableName("wys_property_staff")
public class PropertyStaff {
    @TableId(type = IdType.AUTO)
    @NotNull(message = "id不能为空")
    private Integer id;

    @NotNull(message = "物业员工姓名不能为空")
    @TableField("name")
    private String name;         //物业人员姓名

    @Size(min = 11, max = 11, message = "联系方式为11位")
    @TableField("phone")
    private String phone;       //物业人员联系方式

    @TableField("area")
    private String area;        //物业人员责任区域

    @TableField("update_time")
    private String updateTime;  //物业人员变动更行时间

    @NotNull(message = "密码不能为空")
    @Size(min = 3,max = 15,message = "密码长度为3-15位")
    @TableField("password")
    private String password;    //物业人员所属账号的密码

    @NotNull(message = "密码不能为空")
    @Size(min = 3,max = 12,message = "密码长度为3-12位")
    @TableField("account")
    private String account;     //物业人员所属账号

    @TableField("img")
    private byte[] img;         //物业人员账号头像

    @Valid
    @TableField(exist = false)
    private Role role;

    @TableField(exist = false)
    List<RepairsPlace> places;
}
